/*   1:    */ package com.rinsi.app.zhcx.mkcx;
/*   2:    */ 
/*   3:    */ import com.rinsi.core.service.CoreSimpleService;
/*   4:    */ import com.rinsi.util.AssertUtil;
/*   5:    */ import com.rinsi.util.MapUtil;
/*   6:    */ import java.util.LinkedList;
/*   7:    */ import java.util.List;
/*   8:    */ import java.util.Map;
/*   9:    */ import org.mybatis.spring.SqlSessionTemplate;
/*  10:    */ import org.springframework.stereotype.Service;
/*  11:    */ 
/*  12:    */ @Service
/*  13:    */ public class ZhcxMkcxService
/*  14:    */   extends CoreSimpleService
/*  15:    */ {
/*  16:    */   public void afterIndex(Map<String, Object> model, Map<String, Object> rMap)
/*  17:    */   {
/*  18: 17 */     Map<String, Object> params = getParams(model);
/*  19:    */     
/*  20: 19 */     Map<String, Object> config = getConfig(model);
/*  21:    */     
/*  22: 21 */     int goMkcx = ((Integer)getSqlSessionTemplate().selectOne(namespace(config) + ".goQycx", params)).intValue();
/*  23:    */     
/*  24: 23 */     boolean isGo = goMkcx == 1;
/*  25:    */     
/*  26: 25 */     rMap.put("goQycx", Boolean.valueOf(isGo));
/*  27:    */     
/*  28: 27 */     rMap.put("szss", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(400001)));
/*  29:    */     
/*  30: 29 */     rMap.put("xqfjs", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(200001)));
/*  31:    */     
/*  32: 31 */     rMap.put("mkzts", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(400004)));
/*  33:    */     
/*  34: 33 */     rMap.put("jxs", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(400006)));
/*  35:    */     
/*  36: 35 */     rMap.put("cmfss", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(400010)));
/*  37:    */     
/*  38: 37 */     rMap.put("wsdjs", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(400011)));
/*  39:    */     
/*  40: 39 */     rMap.put("shlxs", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(400015)));
/*  41:    */     
/*  42: 41 */     rMap.put("swdzlxs", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(400016)));
/*  43:    */     
/*  44: 43 */     rMap.put("cjdys", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(400012)));
/*  45:    */     
/*  46: 45 */     rMap.put("azsblxs", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(500005)));
/*  47:    */     
/*  48: 47 */     rMap.put("mklbs", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(400003)));
/*  49:    */     
/*  50: 49 */     rMap.put("wsdjs", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(400011)));
/*  51:    */     
/*  52: 51 */     rMap.put("shlxs", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(400015)));
/*  53:    */     
/*  54: 53 */     rMap.put("kcfss", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(3)));
/*  55:    */     
/*  56: 55 */     rMap.put("wsccs", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(400013)));
/*  57:    */   }
/*  58:    */   
/*  59:    */   public List<Map<String, Object>> outData(Map<String, Object> model)
/*  60:    */   {
/*  61:230 */     Map<String, Object> params = getParams(model);
/*  62:    */     
/*  63:232 */     Map<String, Object> config = getConfig(model);
/*  64:    */     
/*  65:234 */     Map<String, Object> rMap = getRMap();
/*  66:    */     
/*  67:236 */     List<Map<String, Object>> datas = null;
/*  68:    */     try
/*  69:    */     {
/*  70:240 */       beforeList(model);
/*  71:    */       
/*  72:242 */       Integer page = MapUtil.getInteger(params, "page");
/*  73:    */       
/*  74:244 */       Integer rows = MapUtil.getInteger(params, "rows");
/*  75:    */       
/*  76:246 */       datas = getSqlSessionTemplate().selectList(namespace(config) + ".listKj", params);
/*  77:248 */       if ((MapUtil.getInteger(config, "module.page") != null) && (MapUtil.getInteger(config, "module.page").intValue() == 1)) {
/*  78:250 */         if (AssertUtil.isCollectionNotEmpty(datas))
/*  79:    */         {
/*  80:252 */           rMap.put("total", Integer.valueOf(datas.size()));
/*  81:    */           
/*  82:254 */           Integer begin = Integer.valueOf((page.intValue() - 1) * rows.intValue());
/*  83:    */           
/*  84:256 */           Integer end = Integer.valueOf(page.intValue() * rows.intValue());
/*  85:258 */           if (end.intValue() > datas.size()) {
/*  86:260 */             end = Integer.valueOf(datas.size());
/*  87:    */           }
/*  88:263 */           datas = datas.subList(begin.intValue(), end.intValue());
/*  89:    */         }
/*  90:    */         else
/*  91:    */         {
/*  92:267 */           rMap.put("total", Integer.valueOf(0));
/*  93:    */         }
/*  94:    */       }
/*  95:271 */       rMap.put("datas", datas);
/*  96:    */     }
/*  97:    */     catch (Exception ex)
/*  98:    */     {
/*  99:275 */       rMap.put("success", Boolean.valueOf(false));
/* 100:277 */       if (MapUtil.getBoolean(rMap, "shoeExMessage").booleanValue()) {
/* 101:279 */         rMap.put("message", ex.getMessage());
/* 102:    */       } else {
/* 103:283 */         rMap.put("message", "展示数据列表出错！请稍后重试，或联系系统管理员！");
/* 104:    */       }
/* 105:286 */       rMap.put("ex", ex.getMessage());
/* 106:    */       
/* 107:288 */       ex.printStackTrace();
/* 108:    */     }
/* 109:291 */     afterList(model, rMap);
/* 110:    */     
/* 111:293 */     return datas;
/* 112:    */   }
/* 113:    */   
/* 114:    */   public Map<String, Object> list(Map<String, Object> model)
/* 115:    */   {
/* 116:299 */     Map<String, Object> params = getParams(model);
/* 117:    */     
/* 118:301 */     Map<String, Object> config = getConfig(model);
/* 119:    */     
/* 120:303 */     Map<String, Object> rMap = getRMap();
/* 121:    */     try
/* 122:    */     {
/* 123:307 */       beforeList(model);
/* 124:    */       
/* 125:309 */       Integer page = MapUtil.getInteger(params, "page");
/* 126:    */       
/* 127:311 */       Integer rows = MapUtil.getInteger(params, "rows");
/* 128:    */       
/* 129:313 */       List<Map<String, Object>> datas = getSqlSessionTemplate().selectList(namespace(config) + ".list", params);
/* 130:    */       
/* 131:315 */       List<Map<String, Object>> returnDatas = new LinkedList();
/* 132:    */       
/* 133:317 */       StringBuffer Ids = new StringBuffer("");
/* 134:319 */       for (Map<String, Object> map : datas)
/* 135:    */       {
/* 136:321 */         Ids.append(map.get("ORGAN_ID") + ",");
/* 137:    */         
/* 138:323 */         map.put("IDs", Ids.toString().substring(0, Ids.toString().length() - 1));
/* 139:    */         
/* 140:325 */         returnDatas.add(map);
/* 141:    */       }
/* 142:328 */       datas = null;
/* 143:    */       
/* 144:330 */       datas = returnDatas;
/* 145:    */       
/* 146:332 */       returnDatas = null;
/* 147:334 */       if ((MapUtil.getInteger(config, "module.page") != null) && (MapUtil.getInteger(config, "module.page").intValue() == 1)) {
/* 148:336 */         if (AssertUtil.isCollectionNotEmpty(datas))
/* 149:    */         {
/* 150:338 */           rMap.put("total", Integer.valueOf(datas.size()));
/* 151:    */           
/* 152:340 */           Integer begin = Integer.valueOf((page.intValue() - 1) * rows.intValue());
/* 153:    */           
/* 154:342 */           Integer end = Integer.valueOf(page.intValue() * rows.intValue());
/* 155:344 */           if (end.intValue() > datas.size()) {
/* 156:346 */             end = Integer.valueOf(datas.size());
/* 157:    */           }
/* 158:349 */           datas = datas.subList(begin.intValue(), end.intValue());
/* 159:    */         }
/* 160:    */         else
/* 161:    */         {
/* 162:353 */           rMap.put("total", Integer.valueOf(0));
/* 163:    */         }
/* 164:    */       }
/* 165:357 */       rMap.put("datas", datas);
/* 166:    */     }
/* 167:    */     catch (Exception ex)
/* 168:    */     {
/* 169:361 */       rMap.put("success", Boolean.valueOf(false));
/* 170:363 */       if (MapUtil.getBoolean(rMap, "shoeExMessage").booleanValue()) {
/* 171:365 */         rMap.put("message", ex.getMessage());
/* 172:    */       } else {
/* 173:369 */         rMap.put("message", "展示数据列表出错！请稍后重试，或联系系统管理员！");
/* 174:    */       }
/* 175:372 */       rMap.put("ex", ex.getMessage());
/* 176:    */       
/* 177:374 */       ex.printStackTrace();
/* 178:    */     }
/* 179:377 */     afterList(model, rMap);
/* 180:    */     
/* 181:379 */     return rMap;
/* 182:    */   }
/* 183:    */ }


/* Location:           D:\Users\Desktop\shanxi\项目\sxazmis\WEB-INF\classes\
 * Qualified Name:     com.rinsi.app.zhcx.mkcx.ZhcxMkcxService
 * JD-Core Version:    0.7.0.1
 */